package org.awa.demo.opencv.controller;

import lombok.extern.slf4j.Slf4j;
import org.awa.demo.opencv.bean.gltf.GltfRequestDto;
import org.awa.demo.opencv.bean.newgltf.NewGltfRequestDto;
import org.awa.demo.opencv.service.IGltfService;
import org.awa.demo.opencv.service.INewGltfService;
import org.awa.demo.opencv.util.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping(value = "/gltf")
public class GltfController {

    @Autowired
    private IGltfService gltfService;

    @Autowired
    private INewGltfService newGltfService;

    @GetMapping(value = "/v1/gltf/get")
    public R<Object> getInfo() throws Exception{
        log.info("-- begin gltf info get");
        GltfRequestDto gltf = gltfService.getGltf();
        return R.ok(gltf);
    }

    @GetMapping(value = "/v1/gltf/get/new")
    public R<Object> getInfoNew() throws Exception{
        log.info("-- begin gltf info get new");
        NewGltfRequestDto gltf = newGltfService.getGltf();
        return R.ok(gltf);
    }

}
